cmake_minimum_required(VERSION 3.10)

aux_source_directory(src SRC)

add_library(string SHARED ${SRC}) 

set_target_properties(string PROPERTIES WIN32_MANIFEST "NO")

find_package(CxxTest)
if(CXXTEST_FOUND)
    include_directories(${CXXTEST_INCLUDE_DIR})
    enable_testing()
    CXXTEST_ADD_TEST(test_string test_string.cpp 
    	${CMAKE_CURRENT_SOURCE_DIR}/test/stringref.hxx
    	${CMAKE_CURRENT_SOURCE_DIR}/test/stringlist.hxx
    	)
	target_link_libraries(test_string string)
	set_target_properties(test_string PROPERTIES WIN32_MANIFEST "NO")
endif()

install(TARGETS string LIBRARY)